package com.cssw.fyzb.busi.api.live;

import com.cssw.fyzb.busi.service.live.LiveService;
import com.ydn.appserver.Action;
import com.ydn.appserver.Request;
import com.ydn.appserver.Response;
import com.ydn.appserver.annotations.Function;
import com.ydn.appserver.annotations.Parameter;
import com.ydn.appserver.annotations.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: zzf
 * @time: 2020/12/28 19:50
 */
@Function(description = "点赞", parameters = {
        @Parameter(name = "userId", type = Type.String, description = "用户标识", required = true),
        @Parameter(name = "liveId", type = Type.String, description = "直播间标识", required = true),
})
@Component
public class LiveLikes implements Action {

    @Autowired
    LiveService liveService;

    @Override
    public Response execute(Request request) throws Exception {
        String userId = request.getString("userId");
        String liveId = request.getString("liveId");
        liveService.liveLike(liveId, userId);
        return Response.success();
    }
}
